package com.example.petstore.util;

import java.util.UUID;

/*
* 生成支付宝订单号
* */

public class TradeNumber {
    public static String getUUID() {
        UUID uuid = UUID.randomUUID();
        String str = uuid.toString();
        // 去掉"-"符号
        String temp = str.replace("-", "");
        return temp;
    }
    //获得指定数量的UUID
    public static String[] getUUID(int number) {
        if (number < 1) {
            return null;
        }
        String[] uuid = new String[number];
        for (int i = 0; i < number; i++) {
            uuid[i] = getUUID();
            System.out.println(uuid[i]);
        }
        return uuid;
    }
}
